<?php

$utils = new Utils();

class Utils {

	public function taula($taula){
		$sortida = "";
		if(count($taula) > 0){
			$sortida .= "<table class= \"taula\">";
			$sortida .= "<tr>";
			foreach($taula[0] as $clau => $valor) $sortida .= "<th>"._($clau)."</th>";
			$sortida .= "</tr>";
			foreach($taula as $fila){
				$sortida .= "<tr>";
				foreach($fila as $clau => $valor){
					 $sortida .= "<td>$valor</td>";
				}
				$sortida .= "</tr>";
			}
			$sortida .="</table>";
		}
		return $sortida;
	 }
}
?>
